#pragma once

#include "../LibDGGSBase/DGGSDefine.hpp"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"


_NNU_DGGS_BEGIN

namespace Kernel{
        /// <summary>
    /// CuDGGS核心接口定义
    /// </summary>
    class ICuDGGSKernel{
    public:
        /// <summary>
        /// 格网核心库初始化
        /// </summary>
        __DGGS_CPGPU__ virtual void init() = 0;

        /// <summary>
        /// 格网核心库卸载
        /// </summary>
        __DGGS_CPGPU__ virtual void release() = 0;

        /// <summary>
        /// 地理坐标转格网编码
        /// </summary>
        /// <param name="coords"></param>
        /// <param name="elementType"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        __DGGS_CPGPU__ virtual  bool decode(DGGSElementCode code, GeoCoord& coords)=0;

        /// <summary>
        /// 格网编码转地理坐标
        /// </summary>
        /// <param name="code"></param>
        /// <param name="elementType"></param>
        /// <param name="coords"></param>
        /// <returns></returns>
        __DGGS_CPGPU__ virtual bool encode(GeoCoord coords, DGGSElementCode& code)=0;
    };

    /// <summary>
    /// 创建CuDGGS核心接口对象
    /// </summary>
    /// <param name="gridType"></param>
    /// <returns></returns>
    extern "C" __declspec(dllexport) ICuDGGSKernel* CreateCuKernelObj(DGGSGridType gridType);

    /// <summary>
    /// 销毁CuDGGS核心接口对象
    /// </summary>
    /// <param name="kernel"></param>
    /// <returns></returns>
    extern "C" __declspec(dllexport) void DestroyCuKernelObj(ICuDGGSKernel* kernel);
}
_NNU_DGGS_END